package com.zyj.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.zyj.pojo.Category;
@Repository
public class CategoryDao extends BaseDao<Category, Integer>{
	
	@SuppressWarnings("unchecked")
	public List<Category> fingByParentId(int p) {
			String hql = "from Category where parentid = ?";
			Query query = getSession().createQuery(hql);
			query.setParameter(0, p);
			return query.list();
	}

}
